<template>
  <el-menu
    :default-active="defaultActive"
    class="el-menu-vertical-demo"
    @select="select"
    @close="handleClose"
  >
    <el-menu-item index="/list">
      <span slot="title">居民信息</span>
    </el-menu-item>

    <el-menu-item index="/adminList">
      <span slot="title">管理员列表</span>
    </el-menu-item>
  </el-menu>
</template>

<script>
export default {
  data() {
    return {
      defaultActive: "",
    };
  },
  created() {
      // 获取当前的路由信息，拿到当前的路由地址
      this.defaultActive = this.$route.path;
  },
  methods: {
    select(e) {
      this.$router.push(e);
    },
    handleClose() {},
  },
};
</script>